/**
 * 
 */
package masterlink.futures.vo;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author tonyyang
 *
 */
@Entity
@Table(name="SYS_ALERT_SEND")
public class AlertSend implements Serializable{
	
	private static final long serialVersionUID = -1799039377999257603L;
	@EmbeddedId
	private ID id;
	@Column(name="broker")
	private String broker;
	@Column(name="account")
	private String account;
	@Column(name="SEND_SMS")
	private String sendSms;
	@Column(name="ALERT_MSG")
	private String alertMsg;
	@Column(name="SMS_MSG")
	private String smsMsg;
	@Column(name="UPDATE_TIME")
	private Timestamp updateDt;
	/**
	 * @return the id
	 */
	public ID getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(ID id) {
		this.id = id;
	}
	/**
	 * @return the broker
	 */
	public String getBroker() {
		return broker;
	}
	/**
	 * @param broker the broker to set
	 */
	public void setBroker(String broker) {
		this.broker = broker;
	}
	/**
	 * @return the account
	 */
	public String getAccount() {
		return account;
	}
	/**
	 * @param account the account to set
	 */
	public void setAccount(String account) {
		this.account = account;
	}
	/**
	 * @return the sendSms
	 */
	public String getSendSms() {
		return sendSms;
	}
	/**
	 * @param sendSms the sendSms to set
	 */
	public void setSendSms(String sendSms) {
		this.sendSms = sendSms;
	}
	/**
	 * @return the alertMsg
	 */
	public String getAlertMsg() {
		return alertMsg;
	}
	/**
	 * @param alertMsg the alertMsg to set
	 */
	public void setAlertMsg(String alertMsg) {
		this.alertMsg = alertMsg;
	}
	/**
	 * @return the smsMsg
	 */
	public String getSmsMsg() {
		return smsMsg;
	}
	/**
	 * @param smsMsg the smsMsg to set
	 */
	public void setSmsMsg(String smsMsg) {
		this.smsMsg = smsMsg;
	}
	/**
	 * @return the update
	 */
	public Timestamp getUpdateDt() {
		return updateDt;
	}
	/**
	 * @param update the update to set
	 */
	public void setUpdateDt(Timestamp updateDt) {
		this.updateDt = updateDt;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("AlertSend [id=");
		builder.append(id);
		builder.append(", broker=");
		builder.append(broker);
		builder.append(", account=");
		builder.append(account);
		builder.append(", sendSms=");
		builder.append(sendSms);
		builder.append(", alertMsg=");
		builder.append(alertMsg);
		builder.append(", smsMsg=");
		builder.append(smsMsg);
		builder.append(", updateDt=");
		builder.append(updateDt);
		builder.append("]");
		return builder.toString();
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AlertSend other = (AlertSend) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	@Embeddable
	public static class ID implements Serializable{

		private static final long serialVersionUID = -1316377549843822656L;
		@Column(name="EMPNO")
		private String empno;
		@Column(name="ALERT_ID")
		private Long alertId;
		/**
		 * @return the empno
		 */
		public String getEmpno() {
			return empno;
		}
		/**
		 * @param empno the empno to set
		 */
		public void setEmpno(String empno) {
			this.empno = empno;
		}
		/**
		 * @return the alertId
		 */
		public Long getAlertId() {
			return alertId;
		}
		/**
		 * @param alertId the alertId to set
		 */
		public void setAlertId(Long alertId) {
			this.alertId = alertId;
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#toString()
		 */
		@Override
		public String toString() {
			StringBuilder builder = new StringBuilder();
			builder.append("ID [empno=");
			builder.append(empno);
			builder.append(", alertId=");
			builder.append(alertId);
			builder.append("]");
			return builder.toString();
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#hashCode()
		 */
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result
					+ ((alertId == null) ? 0 : alertId.hashCode());
			result = prime * result + ((empno == null) ? 0 : empno.hashCode());
			return result;
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#equals(java.lang.Object)
		 */
		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			ID other = (ID) obj;
			if (alertId == null) {
				if (other.alertId != null)
					return false;
			} else if (!alertId.equals(other.alertId))
				return false;
			if (empno == null) {
				if (other.empno != null)
					return false;
			} else if (!empno.equals(other.empno))
				return false;
			return true;
		}
		
	}
}
